package com.ruoyi.womp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.womp.mapper.WompSparePartsInoutMapper;
import com.ruoyi.womp.domain.WompSparePartsInout;
import com.ruoyi.womp.service.IWompSparePartsInoutService;
import com.ruoyi.common.core.text.Convert;

/**
 * 备件出入库Service业务层处理
 * 
 * @author mzz
 * @date 2023-05-11
 */
@Service
public class WompSparePartsInoutServiceImpl implements IWompSparePartsInoutService 
{
    @Autowired
    private WompSparePartsInoutMapper wompSparePartsInoutMapper;

    /**
     * 查询备件出入库
     * 
     * @param id 备件出入库主键
     * @return 备件出入库
     */
    @Override
    public WompSparePartsInout selectWompSparePartsInoutById(Integer id)
    {
        return wompSparePartsInoutMapper.selectWompSparePartsInoutById(id);
    }

    /**
     * 查询备件出入库列表
     * 
     * @param wompSparePartsInout 备件出入库
     * @return 备件出入库
     */
    @Override
    public List<WompSparePartsInout> selectWompSparePartsInoutList(WompSparePartsInout wompSparePartsInout)
    {
        return wompSparePartsInoutMapper.selectWompSparePartsInoutList(wompSparePartsInout);
    }

    /**
     * 新增备件出入库
     * 
     * @param wompSparePartsInout 备件出入库
     * @return 结果
     */
    @Override
    public int insertWompSparePartsInout(WompSparePartsInout wompSparePartsInout)
    {
        wompSparePartsInout.setCreateTime(DateUtils.getNowDate());
        return wompSparePartsInoutMapper.insertWompSparePartsInout(wompSparePartsInout);
    }

    /**
     * 修改备件出入库
     * 
     * @param wompSparePartsInout 备件出入库
     * @return 结果
     */
    @Override
    public int updateWompSparePartsInout(WompSparePartsInout wompSparePartsInout)
    {
        wompSparePartsInout.setUpdateTime(DateUtils.getNowDate());
        return wompSparePartsInoutMapper.updateWompSparePartsInout(wompSparePartsInout);
    }

    /**
     * 批量删除备件出入库
     * 
     * @param ids 需要删除的备件出入库主键
     * @return 结果
     */
    @Override
    public int deleteWompSparePartsInoutByIds(String ids)
    {
        return wompSparePartsInoutMapper.deleteWompSparePartsInoutByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除备件出入库信息
     * 
     * @param id 备件出入库主键
     * @return 结果
     */
    @Override
    public int deleteWompSparePartsInoutById(Integer id)
    {
        return wompSparePartsInoutMapper.deleteWompSparePartsInoutById(id);
    }
}
